import upload from '@/utils/upload'
import request from '@/utils/request'

// 获取字典数据
export function getDicts(dict, query) {
	return request({
		url: '/system/dict/data/type/' + dict,
		method: 'get',
		params: query
	})
}
// 获取字典值
export function getDictList(dict, query) {
	return new Promise((resolve, reject) => {
		getDicts(dict, query).then(response => {
			const dicts = response.data.map(item => {
				return {
					value: item.dictValue,
					text: item.dictLabel,
					remark:item.remark,
					raw: item
				}
			});
			resolve(dicts);
		}).catch(err => reject(err));
	})
}